000100      
000101140113     h dftactgrp(*no)
000102140113     h actgrp('ITRACE2')
000103140113     h debug(*no)
000104140113     h option(*srcstmt:*nodebugio)
000105140113     h main(PrepareForCatch)
000106140113
000107140113      /include trace2txt,tracetypes
000108140113
000109140113
000110140113      /////////////////////////////////////////////////////////////////////////
000111140113      // Constant declaration
000112140113      /////////////////////////////////////////////////////////////////////////
000113140113
000114140113     d START           c                   const('*START')
000115140113
000116140113     d STOP            c                   const('*STOP')
000117140113
000128140113      /////////////////////////////////////////////////////////////////////////
000129140113      // Global variables
000130140113      /////////////////////////////////////////////////////////////////////////
000131140113
000132140113      /////////////////////////////////////////////////////////////////////////
000133140113      // Prototypes
000134140113      /////////////////////////////////////////////////////////////////////////
000135140113
000136140113     d PrepareForCatch...
000137140113     d                 pr                  extpgm('TRCCATHHDL')
000138140113     d reason                        10a   const
000139140113     d programList                         likeds(FullProgramName_Type)
000140140113     d                                     dim(1024)
000141140113     d                                     const
000142140113     d programCount                  10i 0 const
000143140113
000144140113      /////////////////////////////////////////////////////////////////////////
000145140113      // Exported procedures
000146140113      /////////////////////////////////////////////////////////////////////////
000147140113
000148140113     p PrepareForCatch...
000149140113     p                 b                   export
000150140113     d                 pi
000151140113     d reason                        10a   const
000152140113     d programList                         likeds(FullProgramName_Type)
000153140113     d                                     dim(1024)
000154140113     d                                     const
000155140113     d programCount                  10i 0 const
000157140113
000158140113      /free
000159140113       select;
000160140113         when reason = START;
000164140113           startSourceDebug(stopHandler);
000165140113         when reason = STOP;
000166140113           endSourceDebug();
000167140113         other;
000168140113           return;
000169140113       endsl;
000170140113      /end-free
000171140113     p                 e
000172140113
000173140113      /////////////////////////////////////////////////////////////////////////
000174140113      // Non-exported procedures
000175140113      /////////////////////////////////////////////////////////////////////////
000176140113
000177140113     p startSourceDebug...
000178140113     p                 b
000179140113     d stopHandler     ds                  likeds(QualifiedProgramName_Type)
000180140113     d sepHandler      ds                  likeds(QualifiedProgramName_Type)
000181140113
000182140113      /free
000183140113       stopHandler.name = *blanks;
000184140113       stopHandler.library = *blanks;
000185140113
000186140113       sepHandler.name = '';
000187140113       sepHandler.library = '';
000188140113
000189140113       TRACEAPI_StartSourceDebug(stopHandler);
000190140113
000193140113       TRACEAPI_RegisterServiceEntryPointHandler(sepHandler);
000194140113
000195140113       registerDebugViews();
000196140113
000197140113       retrieveFirstStatement();
000198140113
000199140113       setServiceEntryPoint();
000200140113
000201140113       return;
000202140113      /end-free
000203140113     p                 e
000204140113      //_______________________________________________________________________
000205140113
000206140113     p endSourceDebug  b
000207140113
000208140113      /free
000209140113       return;
000210140113      /end-free
000211140113     p                 e
000212140113      //_______________________________________________________________________
